<%@ page import="java.util.ArrayList" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>jstlprac1</title>
</head>
<body>
<%
 request.setAttribute("password",123);
    ArrayList<String> list = new ArrayList<>();
    list.add("aa");
    list.add("bb");
    list.add("cc");
    list.add("dd");
    pageContext.setAttribute("jstllist",list);
%>
<c:if test="${password eq 123}">
    密码正确
</c:if>
<br/>
<c:choose>
    <c:when test="${password == 456}">密码是456</c:when>
    <c:when test="${password == 369}">密码是369</c:when>
    <c:when test="${password == 777}">密码是777</c:when>
    <c:otherwise>密码是123</c:otherwise>
</c:choose>
<br/>
<c:forEach begin="1" end="10" var="num">${num}<br/></c:forEach>
<c:forEach items="${jstllist}" var="li">${li}<br/></c:forEach>
</body>
</html>
